import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'
import {page} from './page'
export const routes:Array<any> = [
  {
    path: '/',
    name: 'app',
    redirect: '/home',
  },{
    path: '/home',
    name: 'home',
    component:page.home,
    meta:{title:'康有利到家',tabbar:true}
  },{
    path: '/my',
    name: 'my',
    component: page.my,
    meta:{title:'我的',tabbar:true}
  },{
    path: '/worker',
    name: 'worker',
    component: page.worker,
    meta:{title:'技师',tabbar:true}
  },{
    path: '/orderList',
    name: 'orderList',
    component: page.orderList,
    meta:{title:'订单',tabbar:true}
  },{
    path: '/selectWorker',
    name: 'selectWorker',
    component: page.selectWorker,
    meta:{title:'技师选择'}
  },{
    path: '/workerDetail',
    name: 'workerDetail',
    component: page.workerDetail,
    meta:{title:'技师选择'}
  },{
    path: '/serviceDetail',
    name: 'serviceDetail',
    component: page.serviceDetail,
    meta:{title:'服务详情'}
  },{
    path: '/phoneLogin',
    name: 'phoneLogin',
    component: page.phoneLogin,
    meta:{title:'登录'}
  }    
]
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: routes,
  scrollBehavior:()=>{
    return {top: 0}
  }
})
export default router
